import myaxios from "../../MyAxios";

import BASEURL from '@/http/BaseUrl'
const BMDURL = BASEURL.BMDURL
const UPLOADURL = BASEURL.UPLOADURL

const yinshiApi = {
  /**
 * 删除影视
 * @param {Object} params {id:2,type:movie}
 */
  queryDelete(params) {
    let url = BMDURL + "/query-delete"
    return myaxios.post(url, params)
  },

  /**
* 模糊查询-通过页码/每页条目数据  分页查询所有影视
* @param {Object} params {page:1, pagesize:3,name:'火影'}
*/
  queryByname(params) {
    let url = BMDURL + "/query-infosByname"
    return myaxios.get(url, params)
  },

  /**
* 首页轮播图显示(6张图片,按点赞高低排序)
* @param {Object} params {不需传参}
*/
  querytop() {
    let url = BMDURL + "/query-dianzan_lunbo"
    return myaxios.get(url)
  },

  /**
* 通过页码/每页  分页查询所有影视 (用于显示排行榜-按点赞数)
* @param {Object} params {page:1, pagesize:3}
*/
  query_dianzan_count(params) {
    let url = BMDURL + "/query-dianzan_count"
    return myaxios.get(url, params)
  },

  /**
* 通过id 查询影视
* @param {Object} params {id:1, type:dongman}
*/
  queryid(params) {
    let url = BMDURL + "/query-infosByid"
    return myaxios.get(url, params)
  },
  // 上传的是图片路径
  imgUrl(params) {
    // let url=UPLOADURL+ '/upload'
    let url = 'http://121.37.91.153:9020/upload'
    return myaxios.post(url, params)
  },
  // 获取所有国家
  queryCountry(params) {
    let url = BMDURL + '/query_country'
    return myaxios.get(url, params)
  },
  /**
   * 
   * @param {Array} params 
   * @returns 
   */
  // 查询用户收藏 params{user:'zsy'}
  query_collectCount(params) {
    let url = BMDURL + '/query_collectCount'
    return myaxios.get(url, params)
  },
  upLoadForm(params) {
    let url = BMDURL + '/user/tuijian'
    return myaxios.post(url, params)
  },
  //分页查询所有影视评论
  pinglun_all(params){
    let url = BMDURL + '/pinglun_all'
    return myaxios.get(url, params)
  },
  //影视评论
  yinshi_pinglun(params){
    let url = BMDURL + '/yinshi_pinglun'
    return myaxios.post(url, params)
  },
  //影视回复
  yinshi_huifu(params){
    let url = BMDURL + '/yinshi_huifu'
    return myaxios.post(url, params)
  }
  ,
  //分页查询所有影视回复
  huifu_all(params){
    let url = BMDURL + '/huifu_all'
    return myaxios.get(url, params)
  },
   //评论点赞
   pinglun_dz(params){
    let url = BMDURL + '/pinglun_dz'
    return myaxios.post(url, params)
  }
  
}

export default yinshiApi;